Skip to content

Conversation

@oncsr
Copy link
Contributor

@oncsr oncsr commented Apr 10, 2025

🧷 문제 링크

https://www.acmicpc.net/problem/1305

🧭 풀이 시간

15분

👀 체감 난이도

✏️ 문제 설명

전광판에 표시된 길이 L인 문자열이 표시된다.
이 전광판의 문자열은 어떤 문자열 S를 무한히 이어붙인 문자열 중 길이 L만큼을 표시한다.
가능한 S의 최소 길이를 구해보자.

🔍 풀이 방법

[사용한 알고리즘]

  • KMP

주어지는 문자열은 $...SSSSS...$ 형태이다.
접두사와 접미사가 겹치는 최대 부분을 찾아서 한 쪽을 제거하면 S를 찾을 수 있다.

⏳ 회고

어렵다

@oncsr oncsr added the success 👍 해설을 보지 않고 풀었을 때 label Apr 10, 2025
@ShinHeeEul ShinHeeEul merged commit 5dc4704 into main Apr 10, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

success 👍 해설을 보지 않고 풀었을 때

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants